package com.java.ratelimter.controller;

import com.java.ratelimter.aop.RateLimter;
import com.java.ratelimter.common.CommonResult;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

@RestController
@Log4j2
public class TestController {
    @GetMapping("/test")
    @RateLimter(rateKey = "test")
    public CommonResult test() {
        log.info("enter test");
        return new CommonResult(Arrays.asList("test"));
    }
}
